package com.itheima.d2_collection_nesting;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

/*
      目标：理解集合的嵌套。
      江苏省 = "南京市","扬州市","苏州市","无锡市","常州市"
      湖北省 = "武汉市","孝感市","十堰市","宜昌市","鄂州市"
      河北省 = "石家庄市","唐山市", "邢台市", "保定市", "张家口市"
 */
public class Test {
    public static void main(String[] args) {
        HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();
        ArrayList<String> jiangsu = new ArrayList<>();
        Collections.addAll(jiangsu, "南京市","扬州市","苏州市","无锡市","常州市");
        ArrayList<String> hubei = new ArrayList<>();
        Collections.addAll(hubei , "武汉市","孝感市","十堰市","宜昌市","鄂州市");
        ArrayList<String> hebie  = new ArrayList<>();
        Collections.addAll(hebie, "石家庄市","唐山市", "邢台市", "保定市", "张家口市");
        map.put("江苏省",jiangsu);
        map.put("湖北省",hubei);
        map.put("河北省",hebie);
        map.forEach((k,v)->{
            System.out.println(k + ":" );
            for (String s : v) {
                System.out.println(s+" ");

            }
            System.out.println();
        });
    }
}
